<!--
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-11-13 20:45:30
 * @LastEditors: Aroma
 * @LastEditTime: 2024-11-14 09:12:15
 * @别瞎看: 你个无脑牛马
-->
<template>
  <div class = "bg">
    <!-- 注册组件 -->
    <Register v-if="flag"/>
    <!-- 登录 组件 -->
     <Login v-if="!flag"/>
     <p v-if="flag" @click="changeFlag">已有帐号，直接登录</p>
     <p v-if="!flag" @click="changeFlag">没有帐号，立即注册</p>
     <button @click="changeFlag">{{ flag?'去登录页面':'去注册页面' }}</button>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import Login from './components/Login.vue';
import Register from '@/components/Register.vue';

const flag = ref(true);
function changeFlag(){
  flag.value = !flag.value;
}
</script>

<style>
#app {
  text-align: center;
  margin-top: 50px;
}
</style>